<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>always-center</title>
    <style>
        html,
        body {
            height: 100%;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center
        }

        .flex-box {
            width: calc(100vw - 20px);
            height: calc(50vw - 10px);
            background: yellowgreen;
        }
    </style>
</head>

<body>
    <div class="flex-box"></div>
    <!-- <div class="grid-box"></div> -->
</body>

</html>